package com.blkj.framework.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 北浪 2021/11/25
 */
@Configuration
public class MyWebAppConfig implements WebMvcConfigurer {
    /*
        /image/upload/** 表示虚拟路径
        file:/D:/image/upload/ 表示磁盘路径
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/image/upload/**").addResourceLocations("file:/D:/image/upload/");
        WebMvcConfigurer.super.addResourceHandlers(registry);
    }
}
